package shiyan4;
import java.util.List;
import java.util.Scanner;
public class Test {
	

 public static void main(String[] args) {
	 
	 
     Student student1 = new Student(123456, "阿伟");
     Student student2 = new Student(654321, "阿杰");
     room computerRoom = new room("computerRoom001", "计算机网络实验室");
     room compositionRoom = new room("compositionRoom001", "组成原理实验室");
     prize.dePartureRoom(student1, computerRoom);
     prize.dePartureRoom(student2, computerRoom);
     prize.dePartureRoom(student1, compositionRoom);
  // 计算机网络实验室优秀次数
    int computerExcellentCount = 4;
    int computerPassCount = prize.weekCount - computerExcellentCount;
    System.out.println("计算机网络实验室优秀次数:" + computerExcellentCount);
    System.out.println("计算机网络实验室合格次数:" + computerPassCount);
    List<Student> computerStudentList = prize.roomStudentMap.get(computerRoom.getId());
    if (computerStudentList != null) {
     for (int i = 0; i < computerStudentList.size(); i++) {
      Student student = (Student) computerStudentList.get(i);
      student.setExcellentCount(student.getExcellentCount() + computerExcellentCount);
      student.setPassCount(student.getPassCount() + computerPassCount);
   }
  }

  // 组成原理实验室优秀次数
    int compositionExcellentCount = 3;
    int compositionPassCount = prize.weekCount - compositionExcellentCount;
    System.out.println("组成原理实验室优秀次数:" + compositionExcellentCount);
    System.out.println("组成原理实验室合格次数:" + compositionPassCount);

    List<?> compositionStudentList = prize.roomStudentMap.get(compositionRoom.getId());
    if (compositionStudentList != null) {
     for (int i = 0; i < compositionStudentList.size(); i++) {
      Student student = (Student) compositionStudentList.get(i);
      student.setExcellentCount(student.getExcellentCount() + compositionExcellentCount);
      student.setPassCount(student.getPassCount() + compositionPassCount);
   }
  }

    System.out.println("请输入国家最新纳税标准:");
   
  Scanner scanner = new Scanner(System.in);
    while (true) {
     try {
      prize.taxRate = Double.parseDouble(scanner.next());
     break;
     } catch (Exception e) {
      System.err.println("纳税标准输入格式不正确");
      System.out.println("请输入国家最新纳税标准:");
   }
  }
    prize.calculateAccout(student1);
    prize.calculateAccout(student2);
 }
}
